﻿using System;
using UnityEngine;
using UnityEngine.Networking;

// Token: 0x02000323 RID: 803
public class ServerPlayerControl : MonoBehaviour
{
	// Token: 0x060014A8 RID: 5288 RVA: 0x00087F0A File Offset: 0x0008610A
	private void Start()
	{
		NetworkServer.RegisterHandler(37, new NetworkMessageDelegate(this.OnAddPlayerMessage));
		this.modelmanager = IOManager.Instance;
	}

	// Token: 0x060014A9 RID: 5289 RVA: 0x00087F2C File Offset: 0x0008612C
	private void OnAddPlayerMessage(NetworkMessage netMsg)
	{
		GameObject player = UnityEngine.Object.Instantiate<GameObject>(this.modelmanager.LoadRandomPlayerModel(), Vector3.zero, Quaternion.identity);
		NetworkServer.AddPlayerForConnection(netMsg.conn, player, 0);
	}

	// Token: 0x040017A6 RID: 6054
	public GameObject playerPrefab;

	// Token: 0x040017A7 RID: 6055
	private IOManager modelmanager;
}
